package com.wz.bean;


import com.wz.validate.UserSaveValidate;
import com.wz.validate.UserUpdateValidate;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * <p>Project: wz_api - User
 * <p>Powered by pisces On 2022-01-14 11:50:58
 * <P>Created by IntelliJ IDEA
 *
 * @author ww606851@163.com
 * @version 1.0
 * @description:
 * @since 8
 */

@Data
public class User {//只验证有groups的
    @NotBlank(message = "用户名不能为空！",groups = {UserSaveValidate.class, UserUpdateValidate.class})
    String username;
    @Pattern(regexp = "^\\w{6,12}$", message = "密码必须为6-12位数字、字母、下划线组合",groups = {UserSaveValidate.class})
    @NotEmpty(message = "密码不能为空！",groups = {UserSaveValidate.class})
    String password;
    @Pattern(regexp = "^\\w{6,12}$", message = "密码必须为6-12位数字、字母、下划线组合",groups = {UserSaveValidate.class})
    @NotEmpty(message = "确认密码不能为空！",groups = {UserSaveValidate.class})
    String confirmPassword;
    //@Email(message = "请输入合法的email")
    //@NotEmpty(message = "email不能为空！")
    String email;
    //@Pattern(regexp = "^1[356789]\\d{9}$", message = "手机号不合法")
    //@NotEmpty(message = "手机号不能为空！")
    String tel;
    String name;
    String sex;
}
